/* Copyright (c) 2020 by Milan Raring (https://codepen.io/milanraring/pen/QWbqBGo) */
.genesis-checklist {
  --text: var(--font-color);
  --check: var(--primary);
  --disabled: var(--shadow-light);
  --border-radius: 10px;
  border-radius: var(--border-radius);
  position: relative;
  padding: 30px 45px;
  display: grid;
  grid-template-columns: 30px auto;
  -webkit-box-align: center;
  align-items: center;
}
.genesis-checklist label {
  color: var(--text);
  position: relative;
  display: grid;
  -webkit-box-align: center;
  align-items: center;
  width: -webkit-fit-content;
  width: -moz-fit-content;
  width: fit-content;
  -webkit-transition: color 0.3s ease;
  transition: color 0.3s ease;
}
.genesis-checklist label::before,
.genesis-checklist label::after {
  content: "";
  position: absolute;
}
.genesis-checklist label::before {
  height: 2px;
  width: 8px;
  left: -27px;
  background: var(--check);
  border-radius: 2px;
  -webkit-transition: background 0.3s ease;
  transition: background 0.3s ease;
}
.genesis-checklist label:after {
  height: 4px;
  width: 4px;
  top: 8px;
  left: -25px;
  border-radius: 50%;
}

.genesis-checklist input[type="checkbox"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  position: relative;
  height: 15px;
  width: 15px;
  outline: none;
  border: 0;
  margin: 0 15px 0 0;
  display: grid;
  -webkit-box-align: center;
  align-items: center;
}
.genesis-checklist input[type="checkbox"]::before,
.genesis-checklist input[type="checkbox"]::after {
  content: "";
  position: absolute;
  height: 2px;
  top: auto;
  background: var(--check);
  border-radius: 2px;
}
.genesis-checklist input[type="checkbox"]::before {
  width: 0px;
  right: 60%;
  -webkit-transform-origin: right bottom;
  transform-origin: right bottom;
}
.genesis-checklist input[type="checkbox"]::after {
  width: 0px;
  left: 40%;
  -webkit-transform-origin: left bottom;
  transform-origin: left bottom;
}
.genesis-checklist input[type="checkbox"]:checked::before {
  -webkit-animation: check-01 0.4s ease forwards;
  animation: check-01 0.4s ease forwards;
}
.genesis-checklist input[type="checkbox"]:checked::after {
  -webkit-animation: check-02 0.4s ease forwards;
  animation: check-02 0.4s ease forwards;
}
.genesis-checklist input[type="checkbox"]:checked + label {
  color: var(--disabled);
  -webkit-animation: move 0.3s ease 0.1s forwards;
  animation: move 0.3s ease 0.1s forwards;
}
.genesis-checklist input[type="checkbox"]:checked + label::before {
  background: var(--disabled);
  -webkit-animation: slice 0.4s ease forwards;
  animation: slice 0.4s ease forwards;
}
.genesis-checklist input[type="checkbox"]:checked + label::after {
  -webkit-animation: firework 0.5s ease forwards 0.1s;
  animation: firework 0.5s ease forwards 0.1s;
}

@-webkit-keyframes move {
  50% {
    padding-left: 8px;
    padding-right: 0px;
  }
  100% {
    padding-right: 4px;
  }
}

@keyframes move {
  50% {
    padding-left: 8px;
    padding-right: 0px;
  }
  100% {
    padding-right: 4px;
  }
}
@-webkit-keyframes slice {
  60% {
    width: 100%;
    left: 4px;
  }
  100% {
    width: 100%;
    left: -2px;
    padding-left: 0;
  }
}
@keyframes slice {
  60% {
    width: 100%;
    left: 4px;
  }
  100% {
    width: 100%;
    left: -2px;
    padding-left: 0;
  }
}
@-webkit-keyframes check-01 {
  0% {
    width: 4px;
    top: auto;
    -webkit-transform: rotate(0);
    transform: rotate(0);
  }
  50% {
    width: 0px;
    top: auto;
    -webkit-transform: rotate(0);
    transform: rotate(0);
  }
  51% {
    width: 0px;
    top: 8px;
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
  }
  100% {
    width: 5px;
    top: 8px;
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
  }
}
@keyframes check-01 {
  0% {
    width: 4px;
    top: auto;
    -webkit-transform: rotate(0);
    transform: rotate(0);
  }
  50% {
    width: 0px;
    top: auto;
    -webkit-transform: rotate(0);
    transform: rotate(0);
  }
  51% {
    width: 0px;
    top: 8px;
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
  }
  100% {
    width: 5px;
    top: 8px;
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
  }
}
@-webkit-keyframes check-02 {
  0% {
    width: 4px;
    top: auto;
    -webkit-transform: rotate(0);
    transform: rotate(0);
  }
  50% {
    width: 0px;
    top: auto;
    -webkit-transform: rotate(0);
    transform: rotate(0);
  }
  51% {
    width: 0px;
    top: 8px;
    -webkit-transform: rotate(-45deg);
    transform: rotate(-45deg);
  }
  100% {
    width: 10px;
    top: 8px;
    -webkit-transform: rotate(-45deg);
    transform: rotate(-45deg);
  }
}
@keyframes check-02 {
  0% {
    width: 4px;
    top: auto;
    -webkit-transform: rotate(0);
    transform: rotate(0);
  }
  50% {
    width: 0px;
    top: auto;
    -webkit-transform: rotate(0);
    transform: rotate(0);
  }
  51% {
    width: 0px;
    top: 8px;
    -webkit-transform: rotate(-45deg);
    transform: rotate(-45deg);
  }
  100% {
    width: 10px;
    top: 8px;
    -webkit-transform: rotate(-45deg);
    transform: rotate(-45deg);
  }
}
@-webkit-keyframes firework {
  0% {
    opacity: 1;
    box-shadow: 0 0 0 -2px #4f29f0, 0 0 0 -2px #4f29f0, 0 0 0 -2px #4f29f0, 0 0 0 -2px #4f29f0, 0 0 0 -2px #4f29f0, 0 0 0 -2px #4f29f0;
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    box-shadow: 0 -15px 0 0px #4f29f0, 14px -8px 0 0px #4f29f0, 14px 8px 0 0px #4f29f0, 0 15px 0 0px #4f29f0, -14px 8px 0 0px #4f29f0, -14px -8px 0 0px #4f29f0;
  }
}
@keyframes firework {
  0% {
    opacity: 1;
    box-shadow: 0 0 0 -2px #4f29f0, 0 0 0 -2px #4f29f0, 0 0 0 -2px #4f29f0, 0 0 0 -2px #4f29f0, 0 0 0 -2px #4f29f0, 0 0 0 -2px #4f29f0;
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    box-shadow: 0 -15px 0 0px #4f29f0, 14px -8px 0 0px #4f29f0, 14px 8px 0 0px #4f29f0, 0 15px 0 0px #4f29f0, -14px 8px 0 0px #4f29f0, -14px -8px 0 0px #4f29f0;
  }
}
